package com.film.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.film.service.ReviewPriaseService;
import com.film.service.impl.ReviewPriaseServiceImpl;

/**
 * 用户点赞的控制类
 * @author 2119196781
 *
 */
@WebServlet("/reviewPriase.do")
public class ReviewPriaseController extends HttpServlet	{
	private ReviewPriaseService reviewPriaseService = new ReviewPriaseServiceImpl();
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String uId = request.getParameter("uId");
		String revId = request.getParameter("revId");
		String praise = request.getParameter("praise");
		int u_id = Integer.parseInt(uId);
		int rev_id = Integer.parseInt(revId);
		int praises = Integer.parseInt(praise);
		int result = reviewPriaseService.insertReviewPriase(u_id, rev_id,praises);
		
//		JSONObject jsonObject = new JSONObject();
//		jsonObject.put("result", result);
//		response.getWriter().write(jsonObject.toJSONString());
//		response.sendRedirect("selectOneFilm.do?filmId="++"");
		
	}
}
